package com.mohe.shanpao.utils;

import java.net.InetAddress;
import java.net.UnknownHostException;

import ch.qos.logback.classic.pattern.ClassicConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;

/**
 * logback IP配置
 * 
 * @author  caixiang
 * @version  [版本号, 2016年7月5日]
 * @see  [相关类/方法]
 * @since  [产品/模块版本]
 */
public class IpCovert extends ClassicConverter
{
    @Override
    public String convert(ILoggingEvent event)
    {
        try
        {
            return InetAddress.getLocalHost().getHostAddress();
        }
        catch (UnknownHostException e)
        {
            e.printStackTrace();
            return null;
        }
    }
}
